<template>
  <div class="wraper">
    <swiper :options="swiperOption" v-if="showswiper">
      <swiper-slide v-for="item in list" :key="item.id" >
        <img class="swiper-img" :src="item.imgUrl" >
      </swiper-slide>
      <div class="swiper-pagination"  slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: 'homeswiper',
  props: {
    list: Array
  },
  data () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        autoplay: 2500,
        speed: 800,
        autoplayDisableOnInteraction: false,
        loop: true
      }
    }
  },
  computed: {
    showswiper () {
      return this.list.length
    }
  }
}
</script>

<style scoped>
  .wraper >>> .swiper-pagination-bullet-active{
    background: #fff;
  }
  .wraper{
    width: 100%;
    background-color: #eaeaea;
  }
  .swiper-img{
    width: 100%;
  }
</style>
